Skip to content

feat: redesign catalog as v2 TOML superset with on-demand SDKs and GitHub App sync - #40

Merged
nexmoe merged 6 commits into
mainfrom
feat/v2-toml-catalog
Dec 5, 2026
Merged

nexmoe merged 6 commits into
mainfrom
feat/v2-toml-catalog

Conversation

@nexmoe

@nexmoe nexmoe commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Complete v2 redesign of LMSpeed/models (dropping unused v1 endpoints/data cleanly):

  • Human-readable 3-layer TOML catalog (developers/*.toml, models/<dev>/*.toml, providers/<p>/provider.toml, providers/<p>/models/<safe-slug>.toml, aliases.toml):
    • 167 developers, 1,187 canonical models, 336 providers, 10,766 provider listings, 102 deduplicated LobeHub icons (zero vendored SVGs).
    • 100% strict superset of normalized anomalyco/models.dev v2 (1,059 models + 331+ providers + full capabilities/protocols/cost/benchmarks) plus 128 additional canonical models and LMSpeed model extensions ([parameters], multimodal [specs.*], languages, lightweight ASCII [[sources]]).
    • Enforces Windows-safe filenames (no :), strict RFC 3986 ASCII URLs, LobeHub icon existence checks, positive-only limits (no 0 sentinels), and MIT attribution in NOTICE.md.
  • Normalized static v2 API & self-contained shards (1,661 static files total, zero /v1/* routes):
    • /v2/api.json (4.30 MB raw / 568 KB gzip), /v2/models.json (1.17 MB raw / 143 KB gzip), /v2/index.json (82 KB raw), 336 self-contained /v2/providers/{id}.json shards, 1,187 /v2/models/{dev}/{model}.json cards, and 102 deduplicated /v2/logos/{icon}.svg icons.
  • Four lightweight, on-demand, forward-compatible SDKs (0.2.0):
    • JS/TS (0 runtime deps, 5.84 KiB ESM), Python (httpx only, 6.90 KiB), Rust (serde+serde_json+reqwest semver ranges, 16.96 KiB), Go (stdlib only).
    • Five loading tiers (fetchModel, fetchProvider, fetchIndex, fetchModels, refresh), single-flight deduplication, O(1) alias lookup, open enums & nested unknown-field tolerance verified via fixtures/contracts/future-compatible.json.
    • Cold-start full-catalog parse speedup: JS 384ms → 77ms (5x), Python 1,783ms → 95.7ms (18.6x), JS 1,000 alias lookups 60ms → 0.16ms (375x).
  • 3-way merge sync bot & path-aware CI:
    • Dual-source sync (models.dev + lmspeed.net/api/v1/model-specs) with 3-way diff via .sync/upstream-state.json to preserve community edits and TOML comments.
    • Safe batch PR (automation/sync-catalog) + isolated review PRs (automation/sync-review-<target>) published by .github/sync-models/publish.sh via GitHub App token (AUTOMATION_APP_ID / AUTOMATION_APP_PRIVATE_KEY).
    • Path-aware validate.yml (fast ~30s validation for data-only PRs), removed merge-validated.yml workarounds, upgraded Biome to 2.6.9 and GitHub Actions to latest pinned SHAs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant